/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.xm.service;

import com.xm.mapper.AccountMapper;
import com.xm.pojo.Account;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AccountService {
    
    @Autowired
    private AccountMapper accountMapper;
    
    /**
        * 明细查询
        * @param map
        * @return
     */
    public List<Account> selectAccountByDate(Map map)  {
            List<Account> accounts  = accountMapper.selectAccountByDate(map);
            return accounts;
    }
        
    /**
        * 日统计
        * @return
    */
    public List<Map> selectAccountByDay(Map map) {
            List<Map> maps  =  accountMapper.selectAccountByDay(map);
            return maps;
    }

    /**
        * 月统计
        * @return
    */
    public List<Map> selectAccountByMonth(){
    	List<Map> maps  =  accountMapper.selectAccountByMonth();
    	return maps;
    }

    /**
        * 年统计
        * @return
    */
    public List<Map> selectAccountByYear(){
    	List<Map> maps  =  accountMapper.selectAccountByYear();
    	return maps;
    }
        
    /**
        * 插入
        * @param account
    */
    public void saveAccount(Account account) {
    	accountMapper.saveAccount(account);
    }

    /**
        * 根据id删除
        * @param id
    */
    public void removeAccount(Integer id) {
    	accountMapper.removeAccount(id);
    }

}
